﻿using NPOI.SS.Formula.Functions;
using System.Collections.Generic;
using TyMES.Model.BaseInformation;
//using static TyMES.Controllers.TrayBindVSNController;

namespace TyMES.Communication
{
    public record BackTZCode(string SN);
    public record RepairSTStatus(string status,string configName);
    public record LineAndStation(string lineCode,string stationCode);
    public record PersonVerifyRequest(string Id,string password);
    public record BadCodeTemplateRequest(string serviceId, string factoryCode, string operationCode,string updateTime);
    public record PeggingRequest (string serviceId, string factoryCode,string assemblyNumber);
    public record Postpara(Order_Model orderinfo, string sn, string stationCode);
    public record UploadMT(string inv, string stationCode);
    public record AddtionalPassRecord(string AssemblySn);
    public record ResponseBase(bool Success, string Mesg);
    public record TighteningResponse(string ChecKedID, string Result, string Message);
    public record ResponseShipment(bool Success, string ShipmentCode,ResponseShipmentInfo ShipmentInfo,string mesg);                                                                                   
    public record ResponseShipmentInfo(bool Success, string driverType,string materialName,string mesg);
    public record ResponseBaeeNum(bool Success, string Mesg, int res);
    public record ResponseMorder(bool Success, Order_Model Order_Model, string Mesg);
    public record ParaOrderStatus(string LineCode, string orderCode, string scheduleCode, string scheduleStateCode);
    //报工请求体
    public class RPWresquest
    {
        public string serviceId { get; set; }
        public string factoryCode { get; set; }
        public string lineCode { get; set; }
        public string updateTime { get; set; }
        public string requestTime { get; set; }
        public List<RPWbodydata> data { get; set; }
    }

    public class RPWbodydata
    {
        public string orderCode { get; set; }
        public string scheduleCode { get; set; }
        public string scheduleStateCode { get; set; }
    }
    public record RPWResponse(string code, bool success, bool fail, string mesg, string time, string data);

    //调用工厂MES工单信息接口数据Body
    public class ResquestBody
    {
        public string lineCode { get; set; }
        public string orderCode { get; set; }
        public string serviceId { get; set; }
        public string factoryCode { get; set; }
    }
    public record OrderRes(string code, List<OrderData> data, bool success, bool fail, string mesg, string Time);

    public record OrderData(string orderType, string orderCode, string orderQty, string orderStatus, string materialCode, string materialId, string materialName, string materialVersion,
                               string scheduleCode, string scheduleQty, string scheduleEditTime, string scheduleId, string scheduleStationId, string ScheduleStatus, string workshopCode,
                               string workshopName, string lineCode, string lineName, string stationCode, string stationName, string equipmentCode, string startTime, string endTime,
                               string factoryCode, string field1, string field2, string field3, string field4, string field5, string lineSubsectionCode, string lineSubsectionName);

    public record FMOrderRes(List<FMOrderData> data, string requestTime);

    public record FMOrderData(string orderType, string orderCode, string orderQty, string orderStatus, string materialCode, string materialId, string materialName, string materialVersion,
                               string scheduleCode, string scheduleQty, string scheduleEditTime, string scheduleId, string ScheduleStatus, string workshopCode,
                               string workshopName, string lineCode, string lineName, string stationCode, string stationName, string startTime, string endTime,
                               string factoryCode,string lineSubsectionCode,string lineSubsectionName);

    public class ResquestBody4VirtualSN
    {
        public string requestTime { get; set; }
        public string serviceId { get; set; }
        public string factoryCode { get; set; }
        public List<TSdata> data { get; set; }
    }

    public class TSdata
    {
        public string lineCode { get; set; }
        public string orderCode { get; set; }
        public string scheduleCode { get; set; }
        public string barcodeCategory { get; set; }
        public string snQty { get; set; }
        public string stationCode { get; set; }
    };

    public class VSNRes
    {
        public string code { get; set; }
        public List<VSNdata> data { get; set; }
        public bool success { get; set; }
        public bool fail { get; set; }
        public string mesg { get; set; }
        public string Time { get; set; }
    }

    public class VSNdata
    {
        public string barcodeCategory { get; set; }
        public string conEnd { get; set; }
        public string ehDesc { get; set; }
        public string headerLabelName { get; set; }
        public string materialNumber { get; set; }
        public string partsCode { get; set; }
        public string print { get; set; }
        public string printCounts { get; set; }
        public string printVm { get; set; }
        public string productModel { get; set; }
        public string snBarcode { get; set; }
        public string used { get; set; }
        public string vehicleModel { get; set; }
    }
    /// <summary>
    /// 
    /// </summary>
    /// <param name="TrayCode">托盘号</param>
    /// <param name="orderCode">工单号</param>
    /// <param name="scheduleCode">排程号</param>
    /// <param name="barcodeCategory">下发号类型</param>
    /// <param name="snQty">下发数量</param>
    /// <param name="lineCode">工厂MES产线编号</param>
    /// <param name="stationCode">共站号</param>
    public record ParaTrayVSNInfo(string TrayCode, string orderCode, string scheduleCode, string barcodeCategory, string snQty, string lineCode, string stationCode);
    public record MOrderAndSchedule(bool Success, string Mesg, string OrderCode, string ScheduleCode);
    public class FMResponse<T>
    {
        public string code { get; set; }
        public List<T> data { get; set; }
        public bool fail { get; set; }
        public bool success { get; set; }
        public string mesg { get; set; }
        public string time { get; set; }
    }

    public class PeggingReponse
    {
        public string code { get; set; }
        public PegData data { get; set; }
        public bool fail { get; set; }
        public bool success { get; set; }
        public string mesg { get; set; }
        public string time { get; set; }

    }

    public class PegData
    {
        public string assemblyMaterialCode { get; set; }
        public string assemblyMaterialVersion { get; set;}

        public string assemblyNumber { get; set; }
        public string materialCode { get; set; }
        public string materialVersion { get; set; }
        public string snNumber { get; set; }
        public string station_code { get; set; }
    }

    public class ReponseBasic
    {
        public string code { get; set; }
        public string data { get; set; }
        public bool fail { get; set; }
        public bool success { get; set; }
        public string mesg { get; set; }
        public string time { get; set; }

    }
}
